import Vue from 'vue'
import VueRouter from 'vue-router';

const Login = () => import('@/components/Login');
const Home = () => import('@/components/Home');
const addSelect = () => import('@/components/addSelect');
const autoSave = () => import('@/components/autoSave');

Vue.use(VueRouter);

let router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      component: Login,
      name: '登录页'
    },
    {
      path: '/home',
      component: Home,
      name: 'home'
    },
    {
      path: '/',
      component: Home,
      name: 'addSelect',
      menuShow: true,
      children: [
        {path: '/addSelect', component: addSelect, name: '添加选择'}
      ]
    },
    {
      path: '/',
      component: Home,
      menuShow: true,
      children: [
        {
          path: '/autoSave', component: autoSave, isShow: true, name: '自动保存'}
      ]
    }
  ]
})

export default router;
